package lab02.test11;

public class Square extends Rectangle {
    //属性：
    double diagonal;

    //方法：
    double getDiagonal() {
        return diagonal = Math.sqrt(side * side * 2);
    }

    @Override
    public double printMyWay() {
        return side + area + perimeter + diagonal;
    }
}